Electronic devices such as mobile phones, pocket computers, and laptops are widely used in life. Users usually operate the electronic devices through a touch screen or an external keyboard. With the development of high-technology, consumers' demands to the portability and diversity of the electronic devices are increasingly high, for example, reducing the volume of the electronic devices for portability, and providing a touch screen to improve the operability. However, it obviously increases the user's burden if an external keyboard is additionally carried for the sake of easy operation. For this reason, a flexible keyboard is designed in the related art, which can be rolled and stored in a drum for easy storage and carrying. A battery of the existing rollable keyboard, usually installed in a battery compartment which is independently arranged in an end portion of the drum of the rollable keyboard, needs to occupy an additional space, which particularly increases the length of the drum, thus it is inconvenient to carry the existing rollable keyboard.